![]() |
WOLF core
WOLF: A Modular Estimation Framework for Robotics
|
Solver manager using Ceres Solver. More...
#include <core/ceres_wrapper/solver_ceres.h>
Public Member Functions | |
| SolverCeres (const ProblemPtr &_wolf_problem, const YAML::Node &_params) | |
| Constructor from the problem and the YAML parameters. More... | |
| WOLF_SOLVER_CREATE (SolverCeres) | |
| ~SolverCeres () override | |
| ceres::Solver::Summary | getSummary () const |
| Returns the summary of the last solve. More... | |
| std::unique_ptr< ceres::Problem > & | getCeresProblem () |
| Returns the ceres problem. More... | |
| bool | computeCovariancesDerived (CovarianceBlocksToBeComputed _blocks=CovarianceBlocksToBeComputed::ROBOT_LANDMARKS) override |
| Computes the covariances of the specified blocks in the derived solver. More... | |
| bool | computeCovariancesDerived (const std::vector< StateBlockPtr > &st_list) override |
| Computes the covariances of a list of state blocks in the derived solver. More... | |
| bool | converged () const override |
| Returns whether the last solve converged. More... | |
| bool | failed () const override |
| Returns whether the last solve failed. More... | |
| bool | wasStopped () const override |
| Returns whether the last solve was stopped (interrupted by a problem change) More... | |
| unsigned int | iterations () const override |
| Returns the number of iterations of the last solve. More... | |
| double | initialCost () const override |
| Returns the initial cost of the last solve. More... | |
| double | finalCost () const override |
| Returns the final cost of the last solve. More... | |
| double | totalTime () const override |
| Returns the total time of the last solve. More... | |
| ceres::Solver::Options & | getSolverOptions () |
| Returns the ceres solver options. More... | |
| const Eigen::SparseMatrixd | computeHessian () const |
| Computes the Hessian (JᵀJ) of the problem at the current estimate. More... | |
| virtual int | numStateBlocksEstimatedDerived () const override |
| Returns the number of estimated state blocks in the derived solver. More... | |
| virtual int | numFactorsDerived () const override |
| Returns the number of factors in the derived solver. More... | |
| virtual int | sizeStateBlocksEstimatedDerived () const override |
| Returns the total size of the estimated state blocks in the derived solver. More... | |
| virtual int | sizeFactorsDerived () const override |
| Returns the total residual size of the factors in the derived solver. More... | |
Public Member Functions inherited from wolf::SolverManager | |
| void | printProfiling (std::ostream &stream=std::cout) const |
| Prints the profiling of the solver manager (and of the derived solver) More... | |
| const ProfilingUnit & | getProfilingTotal () const |
| Returns the profiling of solve(): update problem, solve and update state. More... | |
| const ProfilingUnit & | getProfilingSolve () const |
| Returns the profiling of the solving. More... | |
| const ProfilingUnit & | getProfilingUpdate () const |
| Returns the profiling of the problem update. More... | |
| const ProfilingUnit & | getProfilingState () const |
| Returns the profiling of the state update. More... | |
| const ProfilingUnit & | getProfilingCov () const |
| Returns the profiling of the covariances computation. More... | |
| SolverManager (const ProblemPtr &_problem) | |
| Constructor with default params_. More... | |
| SolverManager (const ProblemPtr &_problem, const YAML::Node &_params) | |
| Constructor with given params_. More... | |
| virtual | ~SolverManager () |
| Destructor. More... | |
| std::string | solve () |
| Solves with the verbosity defined in params_. More... | |
| std::string | solve (const ReportVerbosity report_level) |
| Solves with a given verbosity. More... | |
| virtual bool | computeCovariances () final |
| Computes the covariances of the blocks specified in the parameters. Returns whether it succeeded. More... | |
| virtual bool | computeCovariances (const CovarianceBlocksToBeComputed blocks) final |
| Computes the covariances of the specified blocks. Returns whether it succeeded. More... | |
| virtual bool | computeCovariances (const std::vector< StateBlockPtr > &st_list) final |
| Computes the covariances (and cross-covariances) of a list of state blocks. Returns whether it succeeded. More... | |
| virtual void | update () |
| Updates solver's problem according to the wolf_problem. More... | |
| ProblemPtr | getProblem () |
| Returns the wolf problem. More... | |
| YAML::Node | getParams () const |
| Returns a copy of the YAML parameters. More... | |
| bool | getComputeCov () const |
| Returns whether the covariances are computed in the solver loop. More... | |
| double | getPeriod () const |
| Returns the period of the solver loop. More... | |
| double | getCovPeriod () const |
| Returns the period of the covariances computation in the solver loop. More... | |
| ReportVerbosity | getVerbosity () const |
| Returns the verbosity of the solver report. More... | |
| virtual bool | isStateBlockRegistered (const StateBlockPtr &state_ptr) const final |
| Returns whether a state block is registered in the solver. More... | |
| virtual bool | isStateBlockFloating (const StateBlockPtr &state_ptr) const final |
| Returns whether a state block is floating: not involved in any factor, so kept out of the solver. More... | |
| virtual bool | isStateBlockFixed (const StateBlockPtr &st) const final |
| Returns whether a registered state block is fixed in the solver. More... | |
| virtual bool | isFactorRegistered (const FactorBasePtr &fac_ptr) const final |
| Returns whether a factor is registered in the solver. More... | |
| virtual bool | hasThisLocalParametrization (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const final |
| Returns whether a state block has a given local parametrization in the solver. More... | |
| virtual bool | hasLocalParametrization (const StateBlockPtr &st) const final |
| Returns whether a state block has a local parametrization in the solver. More... | |
| virtual int | numFactors () const final |
| Returns the number of registered factors. More... | |
| virtual int | sizeFactors () const final |
| Returns the total residual size of the registered factors. More... | |
| virtual int | numStateBlocks () const final |
| Returns the number of state blocks (registered and floating) More... | |
| virtual int | sizeStateBlocks () const final |
| Returns the total size of the state blocks (registered and floating) More... | |
| virtual int | numStateBlocksEstimated () const final |
| Returns the number of estimated state blocks: registered and not fixed. More... | |
| virtual int | sizeStateBlocksEstimated () const final |
| Returns the total size of the estimated state blocks: registered and not fixed. More... | |
| virtual int | numFactorsDerived () const =0 |
| Returns the number of factors in the derived solver. More... | |
| virtual int | sizeFactorsDerived () const =0 |
| Returns the total residual size of the factors in the derived solver. More... | |
| virtual int | numStateBlocksEstimatedDerived () const =0 |
| Returns the number of estimated state blocks in the derived solver. More... | |
| virtual int | sizeStateBlocksEstimatedDerived () const =0 |
| Returns the total size of the estimated state blocks in the derived solver. More... | |
| virtual bool | check (std::string prefix="") const final |
| Checks the consistency of the solver manager and of the derived solver. More... | |
| virtual bool | converged () const =0 |
| Returns whether the last solve converged. More... | |
| virtual bool | failed () const =0 |
| Returns whether the last solve failed. More... | |
| virtual bool | wasStopped () const =0 |
| Returns whether the last solve was stopped (interrupted by a problem change) More... | |
| virtual unsigned int | iterations () const =0 |
| Returns the number of iterations of the last solve. More... | |
| virtual double | initialCost () const =0 |
| Returns the initial cost of the last solve. More... | |
| virtual double | finalCost () const =0 |
| Returns the final cost of the last solve. More... | |
| virtual double | totalTime () const =0 |
| Returns the total time of the last solve. More... | |
| virtual void | run () final |
| Runs the solver loop in a separate thread. More... | |
| virtual void | stop () final |
| Stops the solver loop and joins its thread. More... | |
Protected Member Functions | |
| bool | checkDerived (std::string prefix="") const override |
| Checks the consistency of the derived solver. More... | |
| std::string | solveDerived (const ReportVerbosity report_level) override |
| Solves the problem in the derived solver, returning the report. More... | |
| void | addFactorDerived (const FactorBasePtr &fac_ptr) override |
| Adds a factor to the derived solver. More... | |
| void | removeFactorDerived (const FactorBasePtr &fac_ptr) override |
| Removes a factor from the derived solver. More... | |
| void | addStateBlockDerived (const StateBlockPtr &state_ptr) override |
| Adds a state block to the derived solver. More... | |
| void | removeStateBlockDerived (const StateBlockPtr &state_ptr) override |
| Removes a state block from the derived solver. More... | |
| void | updateStateBlockStatusDerived (const StateBlockPtr &state_ptr) override |
| Updates the fixed/unfixed status of a state block in the derived solver. More... | |
| void | updateStateBlockLocalParametrizationDerived (const StateBlockPtr &state_ptr) override |
| Updates the local parametrization of a state block in the derived solver. More... | |
| ceres::CostFunctionPtr | createCostFunction (const FactorBasePtr &_fac_ptr) |
| Creates the ceres cost function of a factor, depending on its Jacobian method. More... | |
| bool | isFactorRegisteredDerived (const FactorBasePtr &fac_ptr) const override |
| Returns whether a factor is in the derived solver. More... | |
| bool | isStateBlockRegisteredDerived (const StateBlockPtr &state_ptr) const override |
| Returns whether a state block is in the derived solver. More... | |
| bool | isStateBlockFixedDerived (const StateBlockPtr &st) const override |
| Returns whether a state block is fixed in the derived solver. More... | |
| bool | hasThisLocalParametrizationDerived (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const override |
| Returns whether a state block has a given local parametrization in the derived solver. More... | |
| bool | hasLocalParametrizationDerived (const StateBlockPtr &st) const override |
| Returns whether a state block has a local parametrization in the derived solver. More... | |
| void | printProfilingDerived (std::ostream &_stream) const override |
| Prints the profiling of the derived solver. More... | |
Protected Member Functions inherited from wolf::SolverManager | |
| virtual Eigen::VectorXd & | getAssociatedMemBlock (const StateBlockPtr &state_ptr) |
| Returns the state vector of a registered state block used by the solver. More... | |
| const double * | getAssociatedMemBlockPtr (const StateBlockPtr &state_ptr) const |
| Returns a pointer to the state vector of a registered state block used by the solver. More... | |
| double * | getAssociatedMemBlockPtr (const StateBlockPtr &state_ptr) |
| Returns a pointer to the state vector of a registered state block used by the solver. More... | |
| virtual std::string | solveDerived (const ReportVerbosity report_level)=0 |
| Solves the problem in the derived solver, returning the report. More... | |
| virtual bool | computeCovariancesDerived (const CovarianceBlocksToBeComputed blocks)=0 |
| Computes the covariances of the specified blocks in the derived solver. More... | |
| virtual bool | computeCovariancesDerived (const std::vector< StateBlockPtr > &st_list)=0 |
| Computes the covariances of a list of state blocks in the derived solver. More... | |
| virtual void | addFactorDerived (const FactorBasePtr &fac_ptr)=0 |
| Adds a factor to the derived solver. More... | |
| virtual void | removeFactorDerived (const FactorBasePtr &fac_ptr)=0 |
| Removes a factor from the derived solver. More... | |
| virtual void | addStateBlockDerived (const StateBlockPtr &state_ptr)=0 |
| Adds a state block to the derived solver. More... | |
| virtual void | removeStateBlockDerived (const StateBlockPtr &state_ptr)=0 |
| Removes a state block from the derived solver. More... | |
| virtual void | updateStateBlockStatusDerived (const StateBlockPtr &state_ptr)=0 |
| Updates the fixed/unfixed status of a state block in the derived solver. More... | |
| virtual void | updateStateBlockLocalParametrizationDerived (const StateBlockPtr &state_ptr)=0 |
| Updates the local parametrization of a state block in the derived solver. More... | |
| virtual bool | isStateBlockRegisteredDerived (const StateBlockPtr &state_ptr) const =0 |
| Returns whether a state block is in the derived solver. More... | |
| virtual bool | isFactorRegisteredDerived (const FactorBasePtr &fac_ptr) const =0 |
| Returns whether a factor is in the derived solver. More... | |
| virtual bool | isStateBlockFixedDerived (const StateBlockPtr &st) const =0 |
| Returns whether a state block is fixed in the derived solver. More... | |
| virtual bool | hasLocalParametrizationDerived (const StateBlockPtr &st) const =0 |
| Returns whether a state block has a local parametrization in the derived solver. More... | |
| virtual bool | hasThisLocalParametrizationDerived (const StateBlockPtr &st, const LocalParametrizationBasePtr &local_param) const =0 |
| Returns whether a state block has a given local parametrization in the derived solver. More... | |
| virtual void | printProfilingDerived (std::ostream &stream=std::cout) const =0 |
| Prints the profiling of the derived solver. More... | |
| virtual bool | checkDerived (std::string prefix="") const =0 |
| Checks the consistency of the derived solver. More... | |
Protected Attributes | |
| std::map< FactorBasePtr, ceres::ResidualBlockId > | fac_2_residual_idx_ |
| Ceres residual block of each factor. More... | |
| std::map< FactorBasePtr, ceres::CostFunctionPtr > | fac_2_costfunction_ |
| Ceres cost function of each factor. More... | |
| std::map< StateBlockPtr, ManifoldWrapperPtr > | state_blocks_manifold_ |
| Ceres manifold of each state block. More... | |
| ceres::Solver::Summary | summary_ |
| Summary of the last solve. More... | |
| std::unique_ptr< ceres::Problem > | ceres_problem_ |
| Ceres problem. More... | |
| std::unique_ptr< ceres::Covariance > | covariance_ |
| Ceres covariance. More... | |
| unsigned int | n_iter_acc_ |
| Accumulated iterations of all solves. More... | |
| unsigned int | n_iter_max_ |
| Maximum iterations of a single solve. More... | |
| unsigned int | n_convergence_ |
| Solves terminated by convergence. More... | |
| unsigned int | n_interrupted_ |
| Solves terminated by interruption. More... | |
| unsigned int | n_no_convergence_ |
| Solves terminated without convergence. More... | |
| ceres::Solver::Options | solver_options_ |
| Ceres solver options. More... | |
Protected Attributes inherited from wolf::SolverManager | |
| ProblemPtr | wolf_problem_ |
| Wolf problem. More... | |
| ProfilingUnit | profiling_total_ |
| Profiling units of solve(), solving, problem update, state update and covariances computation. More... | |
| ProfilingUnit | profiling_solve_ |
| Solving. More... | |
| ProfilingUnit | profiling_update_ |
| Problem update. More... | |
| ProfilingUnit | profiling_state_ |
| State update. More... | |
| ProfilingUnit | profiling_cov_ |
| Covariances computation. More... | |
| YAML::Node | params_ |
| YAML parameters. More... | |
| std::map< StateBlockPtr, Eigen::VectorXd > | state_blocks_ |
| Registered state blocks and solver states. More... | |
| std::map< StateBlockPtr, FactorBasePtrList > | state_blocks_2_factors_ |
| Factors of each registered state block. More... | |
| std::set< FactorBasePtr > | factors_ |
| Registered factors. More... | |
| std::set< StateBlockPtr > | floating_state_blocks_ |
| State blocks not involved in any factor. More... | |
| double | period_ |
| Period of the solver loop. More... | |
| ReportVerbosity | verbose_ |
| Verbosity of the solver report. More... | |
| bool | compute_cov_ |
| Whether the covariances are computed in the solver loop. More... | |
| CovarianceBlocksToBeComputed | cov_enum_ |
| Covariance blocks computed in the solver loop. More... | |
| double | cov_period_ |
| Period of the covariances computation in the solver loop. More... | |
| std::chrono::high_resolution_clock::time_point | last_cov_time_ |
| Time of the last covariances computation. More... | |
| bool | stopping_ |
| Whether the solver loop has to stop. More... | |
Additional Inherited Members | |
Public Types inherited from wolf::SolverManager | |
| enum class | CovarianceBlocksToBeComputed : std::size_t { ALL = 0 , ALL_MARGINALS = 1 , ROBOT_LANDMARKS = 2 , GAUSS = 3 , GAUSS_TUCAN = 4 , GAUSS_TUCAN_ONLY_POSITION = 5 } |
| Enumeration of covariance blocks to be computed. More... | |
| enum class | ReportVerbosity : std::size_t { QUIET = 0 , BRIEF = 1 , FULL = 2 } |
| Enumeration for the verbosity of the solver report. More... | |
Static Public Member Functions inherited from wolf::SolverManager | |
| static SolverManagerPtr | autoSetup (const ProblemPtr &_problem, const std::string &_input_yaml_file, std::vector< std::string > _primary_schema_folders, bool _skip_yaml_validation=false) |
| Creates a solver from a YAML file (see the YAML node version) More... | |
| static SolverManagerPtr | autoSetup (const ProblemPtr &_problem, YAML::Node _param_node, std::vector< std::string > _primary_schema_folders, bool _skip_yaml_validation=false) |
| Creates a solver from a YAML node (or its 'solver' key), validated against the schemas unless skipped. More... | |
Solver manager using Ceres Solver.
| wolf::SolverCeres::SolverCeres | ( | const ProblemPtr & | _wolf_problem, |
| const YAML::Node & | _params | ||
| ) |
Constructor from the problem and the YAML parameters.
|
override |
|
overrideprotectedvirtual |
Adds a factor to the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Adds a state block to the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Checks the consistency of the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Computes the covariances of a list of state blocks in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Computes the covariances of the specified blocks in the derived solver.
Implements wolf::SolverManager.
| const Eigen::SparseMatrixd wolf::SolverCeres::computeHessian | ( | ) | const |
Computes the Hessian (JᵀJ) of the problem at the current estimate.
|
overridevirtual |
Returns whether the last solve converged.
Implements wolf::SolverManager.
|
protected |
Creates the ceres cost function of a factor, depending on its Jacobian method.
|
overridevirtual |
Returns whether the last solve failed.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the final cost of the last solve.
Implements wolf::SolverManager.
|
inline |
Returns the ceres problem.
|
inline |
Returns the ceres solver options.
|
inline |
Returns the summary of the last solve.
|
inlineoverrideprotectedvirtual |
Returns whether a state block has a local parametrization in the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Returns whether a state block has a given local parametrization in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the initial cost of the last solve.
Implements wolf::SolverManager.
|
inlineoverrideprotectedvirtual |
Returns whether a factor is in the derived solver.
Implements wolf::SolverManager.
|
inlineoverrideprotectedvirtual |
Returns whether a state block is fixed in the derived solver.
Implements wolf::SolverManager.
|
inlineoverrideprotectedvirtual |
Returns whether a state block is in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the number of iterations of the last solve.
Implements wolf::SolverManager.
|
inlineoverridevirtual |
Returns the number of factors in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the number of estimated state blocks in the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Prints the profiling of the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Removes a factor from the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Removes a state block from the derived solver.
Implements wolf::SolverManager.
|
inlineoverridevirtual |
Returns the total residual size of the factors in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the total size of the estimated state blocks in the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Solves the problem in the derived solver, returning the report.
Implements wolf::SolverManager.
|
overridevirtual |
Returns the total time of the last solve.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Updates the local parametrization of a state block in the derived solver.
Implements wolf::SolverManager.
|
overrideprotectedvirtual |
Updates the fixed/unfixed status of a state block in the derived solver.
Implements wolf::SolverManager.
|
overridevirtual |
Returns whether the last solve was stopped (interrupted by a problem change)
Implements wolf::SolverManager.
| wolf::SolverCeres::WOLF_SOLVER_CREATE | ( | SolverCeres | ) |
|
protected |
Ceres problem.
|
protected |
Ceres covariance.
|
protected |
Ceres cost function of each factor.
|
protected |
Ceres residual block of each factor.
|
protected |
Solves terminated by convergence.
|
protected |
Solves terminated by interruption.
|
protected |
Accumulated iterations of all solves.
|
protected |
Maximum iterations of a single solve.
|
protected |
Solves terminated without convergence.
|
protected |
Ceres solver options.
|
protected |
Ceres manifold of each state block.
|
protected |
Summary of the last solve.